<script setup>
import { ref,onMounted } from 'vue'
import Heading from '../components/Heading.jsx'
import Todos from '../components/Todo.jsx'
import { getUser } from '../api/user'
import PieEchart from '../components/PieEchart.vue'
import axios from 'axios'
function getUserInfo(){
    getUser({name:'XXX',password:'XXXX'})
}
let echartData = []
onMounted(()=>{

axios.get('../echart.json').then(res=>{
    // console.log(res,'===============')
    echartData = res.data
})
})

// setTimeout(() => {
    // echartData=[
    //     {value: 43340, name: '123'},
    //     {value: 7003, name: '456'},
    //     {value: 4314, name: '789'}
    // ]
// }, 0);
</script>

<template>
    <div>
        <h1 :leval='3'>hello JSX</h1>
        <button @click="getUserInfo()">点击</button>
    </div>
    <Todos />
    <div v-if="echartData.length>0">
         <pie-echart :value="echartData"/>
    </div>
</template>

<style scoped>

</style>
 